package com.zzh.ribbon.consumer.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author zhengzihong
 * @version 1.0.0
 * @date 2019/1/12
 * @Description
 */
@RestController
public class HelloConsumerController {


    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("/hello")
    public String sayHello(){
        String str = restTemplate.getForObject("http://hello-service/sayHello",String.class);
        return str;
    }


}
